﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Krile.Kernel;
using System.IO;

namespace Highkick.Config
{
    public class Config
    {
        #region Automation

        public static Config LoadConfig()
        {
            try
            {
                if (File.Exists(Path.Combine(Bridge.Config.PluginPath, Define.ConfigFile)))
                    return Bridge.CommonOperation.XMLLoad<Config>(Path.Combine(Bridge.Config.PluginPath, Define.ConfigFile));
                else
                    return new Config();
            }
            catch (Exception e)
            {
                Bridge.DebugReporter.AddReport(e);
                return new Config();
            }
        }

        public void SaveConfig()
        {
            Bridge.CommonOperation.XMLSave<Config>(this, Path.Combine(Bridge.Config.PluginPath, Define.ConfigFile));
        }

        #endregion

        public Account Account = null;

        public int ReceiveInterval = 30;
    }
}
